<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/Web/common/page/jqueryMaster.jsp"%>
<%
	String currentUsername = "";
	if( null == user){
		String url = root + "/common/toLoginPage.jhtml";
		response.sendRedirect(url);
	} else {
		currentUsername = user.getUsername();
	}
%>
<html>
<head>
<script type="text/javascript" src="<%=root%>/Web/record/js/ManageSpecialCars.js"></script>
<script type="text/javascript">
function uploadSpecialCars( ){
	var file = document.forms[0].myFile.value;
	if(!file){
		alert("请选择文件");
		return;
	}

	while (file.indexOf("\\") != -1){
		file = file.slice(file.indexOf("\\") + 1);
	}
	var ext = file.slice(file.indexOf(".")).toLowerCase();
	if (".txt" == ext || ".TXT" == ext)
		document.forms[0].submit();
	else
	alert("对不起，只能上传以下格式的文件: "
	+ ".txt" + "\n请重新选择符合条件的文件"
	+ "再上传.");
	
}

</script>
</head>

<body>
	 <form action="<%=root%>/specialcar/doLoadSpecialCarsFromFile.jhtml" method="post" enctype="multipart/form-data">
	<div style = "height:40px;padding-top:20px;">
		<input type="file" name="myFile">
		<a href="#" class="easyui-linkbutton" icon="icon-edit" onclick="uploadSpecialCars();">批量上传车牌号码</a>
	</div>
	<!-- 表格 -->
	<table 	id="carInfoTable"
		title="特殊车辆信息一览"  
		border="0"
		cellspacing="0"
		cellpadding="0"
		iconCls="icon-edit" 
		idField="carNo" 
		pagination="true"
		remoteSort="false" 
		singleSelect="false" 
		showFooter="false"
		striped="true" 
		url="<%=root %>/specialcar/doLoadSpecialCars.jhtml">
		<thead>
			<tr align="center">
				<th field="id" checkbox="true" width="20"></th>
				<th field="carNo" width="100">车牌号码</th>
				<th field="carOwner" width="150">车主</th>
				<th field="contact" width="150">联系方式</th>
				<th field="comments" width="150">备注</th>
				<th field="opt" formatter='optFormater' align = "center" width="150">操作</th>
			</tr>
		</thead>
	</table>

	<div id="carInfoAdd" icon="icon-save" style="padding: 5px; width: 400px; height: 250px;">
		<h5 id="carInfoAdd_message" style="color: red;"></h5>
		<table id="table_carInfoAdd" onkeydown="if(event.keyCode==13){carInfoAdd();}">
			<tr>
				<td align="right"><b style="font: 12px">车牌号码：</b></td>
				<td>
					<input type="text" class="easyui-validatebox" id="carInfoAdd_carNo" style="width:200px;" maxlength="20" required="true"></input>
				</td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">车主：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoAdd_carOwner" style="width:200px;" maxlength="20"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">联系方式：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoAdd_contact" style="width:200px;" maxlength="20"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">联系方式：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoAdd_comments" style="width:200px;" maxlength="100"></input></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="carInfoAdd();">提交</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="carInfoAddReset();">重置</a>
				</td>
			</tr>
		</table>
	</div>
	
	<div id="carInfoEdit" icon="icon-save" style="padding: 5px; width: 400px; height: 250px;">
		<h5 id="carInfoEdit_message" style="color: red;"></h5>
		<table id="table_carInfoEdit" onkeydown="if(event.keyCode==13){carInfoEdit();}">
			<tr>
				<td align="right"><b style="font: 12px">车牌号码：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoEdit_carNo" style="width:200px;background:#CCCCCC" maxlength="20" readonly></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">车主：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoEdit_carOwner" style="width:200px;" maxlength="20"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">联系方式：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoEdit_contact" style="width:200px;" maxlength="20"></input></td>
			</tr>
			<tr>
				<td align="right"><b style="font: 12px">备注：</b></td>
				<td><input type="text" class="easyui-validatebox" id="carInfoEdit_comments" style="width:200px;" maxlength="100"></input></td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="carInfoEdit();">提交</a>
					<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="carInfoEditReset($('#carInfoEdit_carNo').val());">重置</a>
				</td>
			</tr>
		</table>
	</div>
	</form>
</body>
</html>
